package vip.specimen.system.datasource.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

/**
 * *@Author: 余浪人
 * *@Date：2021/3/5 8:54
 * *@Email:yulangren520@Gmail.com
 * *@QQ:1368419640
 **/
@Getter
@Setter
@Entity
@Table(name = "blogroll")
public class SystemBlogrollEntity extends BaseEntity {
    @Column(length = 128)
    @ApiModelProperty(value = "链接名称")
    private String linkName;
    @Column(length = 256)
    @ApiModelProperty(value = "链接地址")
    private String linkUrl;
    @OneToOne
    @ApiModelProperty(value = "创建者")
    private SystemUserEntity creator;
    @ApiModelProperty(value = "状态")
    private boolean enable = Boolean.FALSE;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "到期时间", dataType = "Date")
    private Date endTime;
    @Column(length = 10)
    @ApiModelProperty(value = "链接颜色")
    private String color;

    public SystemBlogrollEntity() {
    }

    public SystemBlogrollEntity(String linkName, String linkUrl, SystemUserEntity creator, boolean enable, Date endTime, String color) {
        this.linkName = linkName;
        this.linkUrl = linkUrl;
        this.creator = creator;
        this.enable = enable;
        this.endTime = endTime;
        this.color = color;
    }
}
